<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%
    String path = request.getContextPath();
    String basepath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

%>
<html>
<head>
    <base href="<%=basepath %>" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Insert title here</title>
</head>
<body>
    <h1>第一个servlet小例子</h1>
    <hr>
    <%--<a href="servlet/HelloServlet">get 方式请求HelloServlet</a>--%>
    <a href="servlet/HelloServlet">get 方式请求HelloServlet  相对路径</a>
    <a href="<%=path%>/servlet/HelloServlet">get 方式请求HelloServlet  绝对路径</a>

    <form action="servlet/HelloServlet" method="post">
        <input type="submit" value="post 方式请求HelloServlet">
    </form>

    <h1>servlet获取初始化参数</h1>
    <hr>
    <a href="servlet/GetInitParamServlet">servlet获取初始化参数</a>

    <h1>通过url获取参数</h1>
    <hr>
    <a href="servlet/UrlServlet?id=1&name=sunxj">servlet获取初始化参数</a>

</body>
</html>